package co.com.inventarios.persistencia;

import java.util.List;

import co.com.inventarios.modelo.Catvtapro;
import co.com.inventarios.modelo.CatvtaproId;

/**
 * Interface for CatvtaproDAO.
 * 
 * @author MyEclipse Persistence Tools
 */

public interface ICatvtaproDAO {
	/**
	 * Perform an initial save of a previously unsaved Catvtapro entity. All
	 * subsequent persist actions of this entity should use the #update()
	 * method. This operation must be performed within the a database
	 * transaction context for the entity's data to be permanently saved to the
	 * persistence store, i.e., database. This method uses the
	 * {@link javax.persistence.EntityManager#persist(Object) EntityManager#persist}
	 * operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * ICatvtaproDAO.save(entity);
	 * EntityManagerHelper.commit();
	 * </pre>
	 * 
	 * @param entity
	 *            Catvtapro entity to persist
	 * @throws RuntimeException
	 *             when the operation fails
	 */
	public void save(Catvtapro entity);

	/**
	 * Delete a persistent Catvtapro entity. This operation must be performed
	 * within the a database transaction context for the entity's data to be
	 * permanently deleted from the persistence store, i.e., database. This
	 * method uses the
	 * {@link javax.persistence.EntityManager#remove(Object) EntityManager#delete}
	 * operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * ICatvtaproDAO.delete(entity);
	 * EntityManagerHelper.commit();
	 * entity = null;
	 * </pre>
	 * 
	 * @param entity
	 *            Catvtapro entity to delete
	 * @throws RuntimeException
	 *             when the operation fails
	 */
	public void delete(Catvtapro entity);

	/**
	 * Persist a previously saved Catvtapro entity and return it or a copy of it
	 * to the sender. A copy of the Catvtapro entity parameter is returned when
	 * the JPA persistence mechanism has not previously been tracking the
	 * updated entity. This operation must be performed within the a database
	 * transaction context for the entity's data to be permanently saved to the
	 * persistence store, i.e., database. This method uses the
	 * {@link javax.persistence.EntityManager#merge(Object) EntityManager#merge}
	 * operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * entity = ICatvtaproDAO.update(entity);
	 * EntityManagerHelper.commit();
	 * </pre>
	 * 
	 * @param entity
	 *            Catvtapro entity to update
	 * @returns Catvtapro the persisted Catvtapro entity instance, may not be
	 *          the same
	 * @throws RuntimeException
	 *             if the operation fails
	 */
	public Catvtapro update(Catvtapro entity);

	public Catvtapro findById(CatvtaproId id);

	/**
	 * Find all Catvtapro entities with a specific property value.
	 * 
	 * @param propertyName
	 *            the name of the Catvtapro property to query
	 * @param value
	 *            the property value to match
	 * @return List<Catvtapro> found by query
	 */
	public List<Catvtapro> findByProperty(String propertyName, Object value);

	public List<Catvtapro> findByCvpvalor(Object cvpvalor);

	public List<Catvtapro> findByCvpactivo(Object cvpactivo);

	public List<Catvtapro> findByCvpmodfec(Object cvpmodfec);

	/**
	 * Find all Catvtapro entities.
	 * 
	 * @return List<Catvtapro> all Catvtapro entities
	 */
	public List<Catvtapro> findAll();
}